package com.ding.dailyup.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ding.dailyup.enums.YesOrNo;
import com.ding.dailyup.model.StrategyCategory;
import com.ding.dailyup.repository.StrategyCategoryRepository;
import com.google.common.collect.Lists;

@Service
public class StrategyCategoryService {
	@Autowired
	private StrategyCategoryRepository strategyCategoryRepository;

	public List<StrategyCategory> listStrategyCategories() {
		return strategyCategoryRepository
				.findAllByStatusOrderBySortKeyDesc(YesOrNo.YES.value())
				.orElse(Lists.newArrayList());
	}
}
